home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-30 | 1.3 KB | 64 lines | [TEXT/PJMM] |
- unit MyListManager;
-
- interface
-
- function LCountSelections (list: ListHandle): integer;
- function LHasSelection (list: ListHandle): boolean;
- procedure LSetSingleSelection (list: ListHandle; v: integer);
- function LPointToCell (list: ListHandle; pt: Point; var c: cell): boolean;
-
- implementation
-
- function LCountSelections (list: ListHandle): integer;
- var
- c: Cell;
- count: integer;
- begin
- count := 0;
- c.h := 0;
- c.v := 0;
- while LGetSelect(true, c, list) do begin
- count := count + 1;
- c.v := c.v + 1;
- end;
- LCountSelections := count;
- end;
-
- function LHasSelection (list: ListHandle): boolean;
- var
- c: Cell;
- begin
- c.h := 0;
- c.v := 0;
- LHasSelection := LGetSelect(true, c, list);
- end;
-
- procedure LSetSingleSelection (list: ListHandle; v: integer);
- var
- c: Cell;
- begin
- c.h := 0;
- c.v := v;
- LSetSelect(true, c, list);
- c.v := 0;
- c.h := 0;
- while LGetSelect(true, c, list) do begin
- if c.v <> v then begin
- LSetSelect(false, c, list);
- end;
- c.v := c.v + 1;
- c.h := 0;
- end;
- end;
-
- function LPointToCell (list: ListHandle; pt: Point; var c: cell): boolean;
- begin
- c.h := 0;
- c.v := -1;
- if PtInRect(pt, list^^.rView) then begin
- c.v := list^^.visible.top + (pt.v - list^^.rView.top) div list^^.cellSize.v;
- end;
- LPointToCell := PtInRect(c, list^^.dataBounds);
- end;
-
- end.